<?php

class BWeEventModule extends CWebModule {

    protected $uiPath;
    protected $configPath;

    public function init() {
        // this method is called when the module is being created
        // you may place code here to customize the module or the application
        // import the module-level models and components
        $this->setImport(array(
            'BWeEvent.models.*',
            'BWeEvent.components.*',
            'BWeEvent.classes.*',
            'BWeEvent.ui.*',
            'BWeEvent.ui.models.*',
        ));
        Blyn::app()->setActiveNode();
        Blyn::app()->getAppUI()->parseRequest();
        $this->initPaths();
    }

    public function beforeControllerAction($controller, $action) {
        if (parent::beforeControllerAction($controller, $action)) {
            // this method is called before any module controller action is performed
            // you may place customized code here
            return true;
        }
        else
            return false;
    }

    public function afterControllerAction($controller, $action) {
        parent::afterControllerAction($controller, $action);
        Blyn::app()->getUIManager()->renderApp();
    }  

    protected function initPaths($data = NULL) {
        $this->uiPath = Blyn::app()->uiPath = $this->basePath . '.ui.themes.' . Blyn::app()->getAppUI()->getTheme() . '.views';
        $this->configPath = Blyn::app()->configPath = $this->basePath . '.config';
    }

    

}
